import ajax from '../axios/ajax'
import '../mock/userMock'

const BaseUrl = ''
/**
 * 用户登录
 * @param {用户名} username 
 * @param {密码} password 
 */
export const login = (username, password) => ajax(BaseUrl + '/login', { username, password }, 'POST')

/**
 * 用户退出
 * @param {用户对象} user 
 */
export const logout = () => ajax(BaseUrl + '/logout', {}, 'GET')

/**
 * 用户添加
 * @param {用户对象} user 
 */
export const adduUser = (user) => ajax(BaseUrl + 'manage/user/add', user, 'POST')